package ch05.shizhan.shizhan03.impl;

import ch05.shizhan.shizhan03.UserService;
import ch05.shizhan.shizhan03.UserDao;
import ch05.shizhan.shizhan03.User;

/**
 * @author 崔书健
 * @date 2024/7/15
 */
public class UserServiceImpl implements UserService {

    private UserDao userDao;

    /**
     * dao属性的setter访问器，会被Spring调用，实现设置注入
     * @param userDao
     */
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    /**
     * 保存用户信息
     *
     * @param user
     */
    @Override
    public void save(User user) {
        // 调用UserDao的方法保存用户信息
        userDao.save(user);
    }

}
